package com.stlm2.controller;

import com.stlm2.dems.entity.User;
import com.stlm2.dems.service.GoodsRelateCategoryService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by apple on 2017.11.01.
 */
@Controller
@RequestMapping("/goodsRelateCategoryC")
public class GoodsRelateCategoryController {

    @Resource
    private GoodsRelateCategoryService goodsRelateCategoryService;



    /**crm
     * 添加商品 分类对应关系记录
     * ffl
     * 2017-11-01 11:32:55
     * @param token
     * @param levelOneId
     * @param levelTwoId
     * @param levelThreeId
     * @param goodsId
     * @return
     */
    @ResponseBody
    @RequestMapping(value="/add.json",produces="application/json;charset=UTF-8")
    public  String addGoodsRelateCategory(String token,String levelOneId,String levelTwoId,String levelThreeId,String goodsId) {
        return goodsRelateCategoryService.addGoodsRelateCategory(token, levelOneId, levelTwoId, levelThreeId, goodsId);
    }

    /**crm
     *获取商品 的分类
     * ffl
     * 2017-11-01 15:32:09
     * @param token
     * @param goodsId
     * @return
     */
    @ResponseBody
    @RequestMapping(value="/getGoodsCategory.json",produces="application/json;charset=UTF-8")
    public String  getGoodsRelateCategory(String token,String goodsId){
        return goodsRelateCategoryService.getGoodsRelateCategory(token, goodsId);
    }


    /**crm
     * 商品关联商品分类记录无效掉
     * ffl
     * 2017-11-01 15:52:37
     * @param token
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping(value="/setNotValid.json",produces="application/json;charset=UTF-8")
    public String  setNotValid(String token,String id) {
        return goodsRelateCategoryService.setNotValid(token, id);
    }
}
